#include "ota_version.h"
#include "daemon_runner.h"
#include "log/log.h"
#include <string.h>
#include "app_runner.h"

int main(int argc, char const *argv[])
{
  if (argc == 1)
  {
    log_error("至少要有一个参数");
    return -1;
  }
  // 判断是否是app => 运行app模块
  if (strcmp(argv[1], "app") == 0)
  {
    app_runner_run();
  }
  else if (strcmp(argv[1], "ota") == 0)
  {
    ota_version_checkDailyUpdate();
  }
  else if (strcmp(argv[1], "daemon") == 0)
  {
    daemon_runner_start();
  }
  else if (strcmp(argv[1], "version") == 0)
  {
    ota_version_printVersion();
  }
  else
  {
    log_error("参数错误, 请输入app|ota|daemon|version");
}

  return 0;
}